<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .wrap {
            width: 100%;
            height: 600px;
            background: rgb(255, 0, 0);
            margin-top: 100px;
            overflow: auto;
            /* 将wrap改为bfc盒子模型从而使得box的margin-top可以生效 */
        }
        .box {
            width: 100%;
            height: 300px;
            background: rgb(0, 255, 0);
            margin-top: 50px;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="box">

        </div>
    </div>
</body>
</html>